<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<%@page import="br.com.bean.NivelAcessoBean"%>
<%@page import="br.com.controller.NivelAcessoController"%>
<%@page import="br.com.connection.ConnectionFactory"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.List"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro acesso funcionario</title>

<!-- Css Principal -->
<link rel="stylesheet" type="text/css" href="Css/css.css" />
<link rel="stylesheet" href="Jquery/jquery-ui-1.8.19.custom.css" />

<!-- Endereço da jquery -->
<script src="Jquery/jquery-1.6.2.min.js"></script>
<script src="Jquery/jquery-ui-1.8.16.custom.min.js"></script>
<script type='text/javascript' src='Script/nivelsenha.js'></script>
<script type='text/javascript' src='Script/mascaras.js'></script>
 <script type='text/javascript' src='Script/Cadacesso.js'></script>

</head>

<body>

	<div id="html">
	
		 <form method="post" name="fmrcda" id="fmrcda"  action="CadAcessoServlet" onsubmit="return validacadacesso(this);">
		
			<h2>Cadastro de acesso</h2>
			<table>
				<tr>
					<th>Nivel de acesso:</th>
					<td><select name="nacesso" id="nacesso">
					<option value="0">Selecione</option>
					<% Connection conn = new  ConnectionFactory().getConnection(); 
					List<NivelAcessoBean> nacessoList = NivelAcessoController.listNAcesso(conn);
					conn.close();
					for(int i=0; i<nacessoList.size(); i++){
					%>
							<option value="<%=nacessoList.get(i).getId() %>"><%=nacessoList.get(i).getDescricao() %></option>
					<%} %>
					</select>
					</td>
				</tr>
				<tr>
					<th>Nome:</th>
					<td><input type="text" name="nome" id="nome"
						maxlength="150" />
					</td>
				</tr>
				<tr>
					<th>CPF:</th>
					<td><input type="text" name="cpf" id="cpf"
						onblur="javascript: validarCPF(this.value);" onkeypress="javascript: mascara(this, cpf_mask);" onChange="javascript: mascara(this, cpf_maskof);"  maxlength="14" />
					</td>
				</tr>
				<tr>
					<th>E-mail:</th>
					<td><input type="text" name="email" id="email"
						maxlength="50" />
					</td>
				</tr>
				<tr>
					<th>Senha:</th>
					<td><input type="password" name="senha" onkeyup="javascript:verifica()" id="senha" 
						maxlength="10" />
						<td><table id="mostra"></table></td>
					</td>
				</tr>
				<tr>
					<th>Confirmação de senha:</th>
					<td><input type="password" name="confsenha" id="confsenha" 
						maxlength="10" />
					</td>
					
				</tr>
				
			</table>
			<div id="mensagem"></div> 
            
            <input type="submit" name="finalizar" id="finalizar" value="Finalizar" />
			<input type="reset" name="cancelar"	id="cancelar" value="Cancelar" />

	 </form> 
		</div>
<body>
</html>